<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <style>
        .box {
            width:300px;
            height:80px;
            position: relative;
            border: 1px solid red;
        }

        .box::before {
            content: attr(title);
            position: absolute;
            left: 40%;
            transform: translateX(-40%);
            -webkit-transform: translate(-40%, -40%);
            padding: 0 10px;
            background-color: #fff;
        }
    </style>

</head>
<body>
<div class="box" title="使用方法">
    content
</div>
</body>
</html>